<?php

use think\facade\Route;

//首页
Route::get('/', 'index/index')->middleware('verify');

//上传
Route::group('uploads', function () {
    Route::rule('/uploadImage', 'uploads/uploadImage');
    Route::rule('/uploadImageMaterial', 'uploads/uploadImageMaterial');
    Route::rule('/uploadEditorVideo', 'uploads/uploadEditorVideo');
})->ext('html');

Route::group('index', function () {
    Route::get('/index', 'index/index');
    Route::get('/welcome', 'index/welcome');
    Route::get('/clear_cache', 'index/clear_cache');
})->middleware('verify')->ext('html');

//登录
Route::group('login', function () {
    Route::get('/index', 'login/index');
    Route::post('/check', 'login/check');
    Route::post('/logout', 'login/logout');
})->ext('html');

//我的桌面
Route::group('desktop', function () {
    Route::get('/index', 'desktop/statistics');
})->middleware('verify')->ext('html');

Route::group('test', function () {
    Route::get('/index', 'test/index');
    Route::get('/getList', 'test/getList');
})->middleware('verify')->ext('html');

//会员管理
Route::group('user', function () {
    Route::get('/ordinary', 'user/ordinary');
    Route::get('/formal', 'user/formal');
    Route::get('/add', 'user/add');
    Route::get('/edit', 'user/edit');
    Route::get('/getuser', 'user/getuser');
    Route::post('/reset', 'user/reset');
    Route::post('/save', 'user/save');
    Route::post('/login', 'user/login');
    
    Route::rule('/recharge', 'user/recharge','POST|GET');
    Route::rule('/adduser', 'user/adduser','POST|GET');
    Route::get('/export', 'user/export');
    Route::get('/getList', 'user/getList');
    Route::get('/getLevel', 'user/getLevel');
    Route::get('/login', 'user/login');
    Route::post('/update', 'user/update');
    Route::post('/deluser', 'user/deluser');
    Route::post('/delete', 'user/delete');
})->middleware('verify')->ext('html');

//推荐关系
Route::group('relation', function () {
    Route::get('/index', 'relation/index');
    Route::get('/algebra', 'relation/algebra');
    Route::get('/getData', 'relation/getData');
})->middleware('verify');

//财务管理
Route::group('account', function () {
    Route::get('/index', 'account/index');
    Route::get('/recharge', 'account/recharge');
    Route::get('/bonus', 'account/bonus');
    Route::get('/add', 'account/add');
    Route::get('/edit', 'account/edit');
    Route::get('/export', 'account/export');
    Route::get('/getList', 'account/getList');
})->middleware('verify');

//充值管理
Route::group('remit', function () {
    Route::get('/index', 'remit/index');
    Route::get('/add', 'remit/add');
    Route::get('/edit', 'remit/edit');
    Route::get('/export', 'remit/export');
    Route::get('/getList', 'remit/getList');
    Route::post('/save', 'remit/save');
    Route::post('/batch', 'remit/batch');
})->middleware('verify');

//提现管理
Route::group('draw', function () {
    Route::get('/index', 'draw/index');
    Route::get('/add', 'draw/add');
    Route::get('/edit', 'draw/edit');
    Route::get('/export', 'draw/export');
    Route::get('/getList', 'draw/getList');
    Route::post('/save', 'draw/save');
    Route::post('/saveDraw', 'draw/saveDraw');
    Route::post('/batch', 'draw/batch');
})->middleware('verify');

//转账管理
Route::group('transfer', function () {
    Route::get('/index', 'transfer/index');
    Route::get('/export', 'remit/export');
    Route::get('/getList', 'transfer/getList');
})->middleware('verify');

//转换管理
Route::group('exchange', function () {
    Route::get('/index', 'exchange/index');
    Route::get('/export', 'exchange/export');
    Route::get('/getList', 'exchange/getList');
})->middleware('verify');

//奖金管理
Route::group('summaryUser', function () {
    Route::get('/index', 'summaryUser/index');
    Route::get('/getList', 'summaryUser/getList');
    Route::get('/export', 'summaryUser/export');
    Route::get('/summary_info', 'summaryUser/summary_info');
})->middleware('verify');

//奖金管理
Route::group('summaryDate', function () {
    Route::get('/index', 'summaryDate/index');
    Route::get('/getList', 'summaryDate/getList');
    Route::get('/export', 'summaryDate/export');
    Route::get('/summary_info', 'summaryDate/summary_info');
})->middleware('verify');

//新闻公告
Route::group('news', function () {
    Route::get('/index', 'news/index');
    Route::get('/getList', 'news/getList');
    Route::get('/add', 'news/add');
    Route::get('/edit', 'news/edit');
    Route::get('/export', 'news/export');
    Route::post('/save', 'news/save');
    Route::post('/update', 'news/update');
    Route::post('/delete', 'news/delete');
})->middleware('verify');

//轮播管理
Route::group('carousel', function () {
    Route::get('/index', 'carousel/index');
    Route::get('/getList', 'carousel/getList');
    Route::get('/add', 'carousel/add');
    Route::get('/edit', 'carousel/edit');
    Route::post('/save', 'carousel/save');
    Route::post('/update', 'carousel/update');
    Route::post('/delete', 'carousel/delete');
})->middleware('verify');


//留言管理
Route::group('message', function () {
    Route::get('/index', 'message/index');
    Route::get('/getList', 'message/getList');
    Route::get('/add', 'message/add');
    Route::get('/edit', 'message/edit');
    Route::post('/save', 'message/save');
})->middleware('verify');

//消息管理
Route::group('notice', function () {
    Route::get('/group', 'notice/group');
    Route::get('/getData', 'notice/getData');
    Route::get('/show_order', 'notice/show_order');
    Route::get('/show_user', 'notice/show_user');
    Route::get('/show_message', 'notice/show_message');
    Route::get('/all_read', 'notice/all_read');
    Route::get('/noticeCount', 'notice/noticeCount');
})->middleware('verify');

//商品分类
Route::group('productCate', function () {
    Route::get('/index', 'productCate/index');
    Route::get('/add', 'productCate/add');
    Route::get('/edit', 'productCate/edit');
    Route::get('/getCate', 'productCate/getCate');
    Route::post('/save', 'productCate/save');
    Route::rule('/update', 'productCate/update');
    Route::get('/updateStatus', 'productCate/updateStatus');
    Route::get('/updateIsShow', 'productCate/updateIsShow');
})->middleware('verify');

//积分商品分类
Route::group('lntegralCate', function () {
    Route::get('/index', 'lntegralCate/index');
    Route::get('/add', 'lntegralCate/add');
    Route::get('/edit', 'lntegralCate/edit');
    Route::get('/getCate', 'lntegralCate/getCate');
    Route::post('/save', 'lntegralCate/save');
    Route::rule('/update', 'lntegralCate/update');
    Route::get('/updateStatus', 'lntegralCate/updateStatus');
    Route::get('/updateIsShow', 'lntegralCate/updateIsShow');
})->middleware('verify');
//积分商品列表
Route::group('lntegral', function () {
    Route::get('/index', 'lntegral/index');
    Route::get('/getProduct', 'lntegral/getProduct');
    Route::get('/getCoupon', 'lntegral/getCoupon');
    Route::get('/getList', 'lntegral/getList');
    Route::get('/add', 'lntegral/add');
    Route::get('/edit', 'lntegral/edit');
    Route::post('/save', 'lntegral/save');
    Route::post('/saveProduct', 'lntegral/saveProduct');
    
    Route::rule('/update', 'lntegral/update');
    Route::post('/delete', 'lntegral/delete');
})->middleware('verify');

//积分商品规格
Route::group('lntegralSpec', function () {
    Route::get('/index', 'lntegralSpec/index');
    Route::get('/getList', 'lntegralSpec/getList');
    Route::get('/add', 'lntegralSpec/add');
    Route::get('/edit', 'lntegralSpec/edit');
    Route::get('/getSpec', 'lntegralSpec/getSpec');
    Route::post('/save', 'lntegralSpec/save');
    Route::post('/saveSpec', 'lntegralSpec/saveSpec');
    Route::rule('/update', 'lntegralSpec/update');
    Route::post('/delete', 'lntegralSpec/delete');
})->middleware('verify');


//商品规格
Route::group('spec', function () {
    Route::get('/index', 'spec/index');
    Route::get('/getList', 'spec/getList');
    Route::get('/add', 'spec/add');
    Route::get('/edit', 'spec/edit');
    Route::get('/getSpec', 'spec/getSpec');
    Route::post('/save', 'spec/save');
    Route::post('/saveSpec', 'spec/saveSpec');
    Route::rule('/update', 'spec/update');
    Route::post('/delete', 'spec/delete');
})->middleware('verify');

//商品列表
Route::group('product', function () {
    Route::get('/index', 'product/index');
    Route::get('/examine', 'product/examine');
    Route::get('/getProduct', 'product/getProduct');
    Route::get('/getList', 'product/getList');
    Route::get('/add', 'product/add');
    Route::get('/edit', 'product/edit');
    Route::post('/save', 'product/save');
    Route::post('/saveProduct', 'product/saveProduct');
    
    Route::rule('/update', 'product/update');
    Route::post('/delete', 'product/delete');
})->middleware('verify');


//优惠券列表
Route::group('coupon', function () {
    Route::get('/index', 'coupon/index');
    Route::get('/getList', 'coupon/getList');
    Route::get('/add', 'coupon/add');
    Route::get('/edit', 'coupon/edit');
    Route::post('/save', 'coupon/save');
    Route::post('/savepsot', 'coupon/savepsot');
    Route::rule('/update', 'coupon/update');
    Route::post('/delete', 'coupon/delete');
})->middleware('verify');


//领取优惠券列表
Route::group('usercoupon', function () {
    Route::get('/index', 'usercoupon/index');
    Route::get('/getList', 'usercoupon/getList');
    Route::get('/add', 'usercoupon/add');
    Route::get('/edit', 'usercoupon/edit');
    Route::post('/save', 'usercoupon/save');
    Route::rule('/update', 'usercoupon/update');
    Route::post('/delete', 'usercoupon/delete');
})->middleware('verify');



//秒杀列表
Route::group('seckill', function () {
    Route::get('/index', 'seckill/index');
    Route::get('/getList', 'seckill/getList');
    Route::get('/add', 'seckill/add');
    Route::get('/edit', 'seckill/edit');
    Route::post('/saveSeckill', 'seckill/saveSeckill');
    Route::rule('/update', 'seckill/update');
    Route::post('/delete', 'seckill/delete');
})->middleware('verify');


//秒杀商品管理列表
Route::group('seckillProduct', function () {
    Route::get('/index', 'seckillProduct/index');
    Route::get('/getList', 'seckillProduct/getList');
    Route::get('/add', 'seckillProduct/add');
    Route::get('/edit', 'seckillProduct/edit');
    Route::get('/getProduct', 'seckillProduct/getProduct');
    
    Route::post('/saveSeckill', 'seckillProduct/saveSeckill');
    Route::rule('/update', 'seckillProduct/update');
    Route::post('/delete', 'seckillProduct/delete');
})->middleware('verify');


//商品满减管理列表
Route::group('productFull', function () {
    Route::get('/index', 'productFull/index');
    Route::get('/getList', 'productFull/getList');
    Route::get('/add', 'productFull/add');
    Route::get('/edit', 'productFull/edit');
    Route::post('/save', 'productFull/save');
    Route::post('/savepsot', 'productFull/savepsot');
    Route::rule('/update', 'productFull/update');
    Route::post('/delete', 'productFull/delete');
})->middleware('verify');

//运费模板
Route::group('freightPlate', function () {
    Route::get('/index', 'freightPlate/index');
    Route::get('/getList', 'freightPlate/getList');
    Route::get('/add', 'freightPlate/add');
    Route::get('/edit', 'freightPlate/edit');
    Route::post('/save', 'freightPlate/save');
    Route::post('/savepsot', 'freightPlate/savepsot');
    
    Route::rule('/update', 'freightPlate/update');
    Route::post('/delete', 'freightPlate/delete');
})->middleware('verify');

//运费模板
Route::group('freight', function () {
    Route::get('/index', 'freight/index');
    Route::get('/getList', 'freight/getList');
    Route::get('/add', 'freight/add');
    Route::get('/edit', 'freight/edit');
    Route::post('/save', 'freight/save');
    Route::rule('/update', 'freight/update');
    Route::post('/delete', 'freight/delete');
})->middleware('verify');

//订单管理
Route::group('order', function () {
    Route::get('/index', 'order/index');
    Route::get('/getList', 'order/getList');
    Route::get('/add', 'order/add');
    Route::get('/edit', 'order/edit');
    Route::get('/export', 'order/export');
    Route::get('/getArea', 'order/getArea');
    Route::post('/save', 'order/save');
    Route::post('/update', 'order/update');
    Route::post('/delete', 'order/delete');
    Route::rule('/deliver', 'order/deliver');
    Route::rule('/savePostage', 'order/savePostage');
    Route::rule('/saveMoney', 'order/saveMoney');
    Route::rule('/statistics', 'order/statistics');
    Route::post('/exportOrder', 'order/exportOrder');
})->middleware('verify');
//退款管理
Route::group('orderRefund', function () {
    Route::get('/index', 'orderRefund/index');
    Route::get('/getList', 'orderRefund/getList');
    Route::get('/add', 'orderRefund/add');
    Route::get('/edit', 'orderRefund/edit');
    Route::get('/export', 'orderRefund/export');
    Route::get('/getArea', 'orderRefund/getArea');
    Route::post('/save', 'orderRefund/save');
    Route::post('/update', 'orderRefund/update');
    Route::post('/delete', 'orderRefund/delete');
    Route::rule('/deliver', 'orderRefund/deliver');
    Route::post('/refund', 'orderRefund/refund');
})->middleware('verify');
//菜单管理
Route::group('menu', function () {
    Route::get('/index', 'menu/index');
    Route::get('/getList', 'menu/getList');
    Route::get('/add', 'menu/add');
    Route::get('/edit', 'menu/edit');
    Route::post('/save1', 'menu/save1');
    Route::get('/updateStatus', 'menu/updateStatus');
    Route::post('/delete', 'menu/delete');
})->middleware('verify');

//快递管理
Route::group('express', function () {
    Route::get('/index', 'express/index');
    Route::get('/getList', 'express/getList');
    Route::get('/add', 'express/add');
    Route::get('/edit', 'express/edit');
    Route::post('/save', 'express/save');
    Route::post('/update', 'express/update');
    Route::post('/delete', 'express/delete');
})->middleware('verify');

//网站配置
Route::group('config', function () {
    Route::get('/index', 'config/index');
    Route::get('/getList', 'config/getList');
    Route::get('/add', 'config/add');
    Route::get('/edit', 'config/edit');
    Route::post('/save', 'config/save');
    Route::post('/update', 'config/update');
    Route::post('/delete', 'config/delete');
    Route::get('/create', 'config/create');
    Route::post('/saveGroup', 'config/saveGroup');
})->middleware('verify');

//角色管理
Route::group('role', function () {
    Route::get('/index', 'role/index');
    Route::get('/getList', 'role/getList');
    Route::get('/add', 'role/add');
    Route::get('/edit', 'role/edit');
    Route::post('/save', 'role/save');
    Route::post('/update', 'role/update');
    Route::post('/delete', 'role/delete');
    Route::rule('/give', 'role/give');
})->middleware('verify');

//用户列表
Route::group('admin', function () {
    Route::get('/index', 'admin/index');
    Route::get('/getList', 'admin/getList');
    Route::get('/add', 'admin/add');
    Route::get('/edit', 'admin/edit');
    Route::post('/save', 'admin/save');
    Route::post('/update', 'admin/update');
    Route::post('/delete', 'admin/delete');
    Route::rule('/password', 'admin/password');
})->middleware('verify');


//数据管理
Route::group('backup', function () {
    Route::get('/index', 'backup/index');
    Route::get('/add', 'backup/add');
    Route::get('/import', 'backup/import');
    Route::get('/clear', 'backup/clear');
    Route::get('/backup', 'backup/delete');
})->middleware('verify');

//操作日志
Route::group('logs', function () {
    Route::get('/index', 'logs/index');
    Route::get('/getList', 'logs/getList');
    Route::get('/queryIp', 'logs/queryIp');
})->middleware('verify');

//素材管理
Route::group('materialLibrary', function () {
    Route::get('/index', 'materialLibrary/index');
    Route::get('/open', 'materialLibrary/open');
    Route::post('/addGroup', 'materialLibrary/addGroup');
    Route::post('/destroy', 'materialLibrary/destroy');
    Route::post('/destroyGroup', 'materialLibrary/destroyGroup');
    Route::post('/saveGroup', 'materialLibrary/saveGroup');
})->ext('html');


//申请分销商
Route::group('makePlace', function () {
    Route::get('/index', 'makePlace/index');
    Route::get('/getList', 'makePlace/getList');
    Route::get('/add', 'makePlace/add');
    Route::get('/edit', 'makePlace/edit');
    Route::post('/save', 'makePlace/save');
    Route::post('/update', 'makePlace/update');
    Route::post('/delete', 'makePlace/delete');
    Route::post('/batch', 'makePlace/batch');
    Route::post('/batchFail', 'makePlace/batchFail');
})->middleware('verify');


//会员等级
Route::group('level', function () {
    Route::get('/index', 'level/index');
    Route::get('/getList', 'level/getList');
    Route::get('/add', 'level/add');
    Route::get('/edit', 'level/edit');
    Route::post('/save', 'level/save');
    Route::post('/update', 'level/update');
    Route::post('/delete', 'level/delete');
})->middleware('verify');


//足迹
Route::group('footPrint', function () {
    Route::get('/index', 'footPrint/index');
    Route::get('/getList', 'footPrint/getList');
    Route::get('/add', 'footPrint/add');
    Route::get('/edit', 'footPrint/edit');
    Route::get('/export', 'footPrint/export');
    Route::post('/save', 'footPrint/save');
    Route::post('/update', 'footPrint/update');
    Route::post('/delete', 'footPrint/delete');
})->middleware('verify');
//定时测试
Route::group('test', function () {
    Route::get('/index','test/index');
    Route::post('/execute','test/execute');
})->middleware('verify')->ext('html');